#ifndef _H_I_PROTOCOL_CHANNEL_H_
#define _H_I_PROTOCOL_CHANNEL_H_

#include "../typedefine.h"
#include "ProtocolDelegate.h"
#include "SProtocolEndPoint.h"

namespace QWER
{
	QDLL_EXPORT QINTERFACE IProtocolChannel
	{
	public:
#ifndef _USING_CLI
		virtual ~IProtocolChannel(){}
#endif
		virtual CPromise<BOOLN>* Send(UINT64 qwChannelUID, QMOVEABLE(std::vector<UINT8>) poStream) = 0;
        virtual CPromise<CUniquePtr(std::vector<UINT8>)>* Recv(UINT64 qwChannelUID, UINT32 dwRecvLen) = 0;
        virtual BOOLN IsValidListenAddress(CONST_REF(CString) rstrAddress) = 0;
        virtual CPromise<UINT64>* Listen(CONST_REF(CString) rstrAddress, CONST_PTR_OR_REF(DOnProtocolChannelAccepted) rcbOnProtocolChannelAccepted) = 0;
        virtual BOOLN IsValidConnectAddress(CONST_REF(CString) rstrAddress) = 0;
        virtual CPromise<UINT64>* Connect(CONST_REF(CString) rstrAddress) = 0;
        virtual void Close(UINT64 qwChannelUID) = 0;
        virtual void AddCloseListener(UINT64 qwChannelUID, CONST_PTR_OR_REF(DOnProtocolChannelClosed) rcbOnProtocolChannelClosed) = 0;
	};
}

#endif
